<?php


namespace App\Helpers;


use App\Models\ArticleCategory;

class ScoresComputed
{
    //获取分类分数
    public function getCategoryScore($id){
        return ArticleCategory::query()->where('id',$id)->value('score');
    }
    //统计分数
    public function getComputedArticleScore($rate,$id){
        $score = $this->getCategoryScore($id);
        return $score*$rate;
    }
}
